home *** CD-ROM | disk | FTP | other *** search
- unit Dddfunit;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, FileCtrl, ExtCtrls, Buttons, Grids, Outline,
- DirOutln;
-
- type
- TDestDDForm = class(TForm)
- Panel1: TPanel;
- Panel2: TPanel;
- DriveComboBox1: TDriveComboBox;
- BitBtn1: TBitBtn;
- BitBtn2: TBitBtn;
- Panel3: TPanel;
- Label1: TLabel;
- DirectoryListBox1: TDirectoryListBox;
- procedure FormCreate(Sender: TObject);
- procedure DirectoryListBox1Change(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- function GetTargetDirectory : String;
- end;
-
- var
- DestDDForm: TDestDDForm;
-
- implementation
-
- {$R *.DFM}
-
- { Delphi wrote this; use it to set up the path label }
- procedure TDestDDForm.FormCreate(Sender: TObject);
- begin
- Label1.Caption := DirectoryListBox1.Directory;
- end;
-
-
- { Use this to get a correctly \-terminated pathname }
- function TDestDDForm.GetTargetDirectory : String;
- var TheString : String;
- begin
- TheString := DirectoryListBox1.Directory;
- if TheString[ Length( TheString )] = '\' then GetTargetDirectory
- := TheString else GetTargetDirectory := TheString + '\';
- end;
-
- { Delphi wrote this; use it to keep the label synchronized with the listbox }
- procedure TDestDDForm.DirectoryListBox1Change(Sender: TObject);
- begin
- Label1.Caption := DirectoryListBox1.Directory;
- Label1.Show;
- end;
-
- end.
-